1. Field of the Invention
The present invention relates to the processing of encoded signals.
2. Description of the Prior Art
It is known to digitally encode signals according to the MPEG 2 standard defined in ISO/IEC 13818-2. A signal encoded according to MPEG 2 comprises I-frames and P and/or B-frames. I-frames or intra-encoded frames are frames in which all the information necessary to decode the frame is preserved within the frame. P and B-frames are inter-encoded frames. P and B-frames contain motion-compensated differences between two-frames. In practice the difference is between a frame and a prediction derived from one or two other frames. The differences are ultimately referenced to one or two I-frames. P-frames are predicted from a single preceding reference frame which may be an I-frame or a P-frame. B-frames are bidirectionally interpolated from the nearest preceding I or P frame and the nearest succeeding I or P frame. The encoded frames are organised into a Group of Pictures or GOP of which at least one frame is an I-frame, and which may include one or more B and/or P frames.
FIG. 10A is a block diagram of a typical MPEG 2 signal encoder. The operation of such an encoder is well known and therefore will be described only briefly herein.
The compressor of FIG. 10A comprises a frame re-orderer 80, a motion vector estimator 81, a motion compensator 89, a subtracter 82, an adder 88, a DCT transform unit 85, a quantizer 84, an entropy encoder 85, an inverse quantizer 86 and an inverse DCT unit 87.
As is known in MPEG, blocks of transformed data are organised into macroblocks and the macroblocks are assembled into slices and slices into pictures. There are the three types of picture, I, B and P described above.
The frame reorderer 80 receives input video data and acts on successive groups of pictures (GOP) to reorder the pictures so that each picture within the GOP is compressed after those pictures on which it depends. For example, if a B-picture (bi-directionally predicted picture) depends on a following I- or P- picture, it is reordered to be compressed after that I- or P- picture.
For example, if a GOP comprises the following four initial frames (in the order in which they are displayed), I.sub.0 B.sub.1 B.sub.2 P.sub.3 . . . , where the P-picture uses the I-picture as a reference and the two B- pictures use the surrounding I- and P-pictures as references, then the frame reorderer 80 will reorder the GOP to be compressed in the following order: I.sub.0 P.sub.3 B.sub.1 B.sub.2 . . . . The pictures are also transmitted to the decoder for decoding in that order I.sub.0 P.sub.3 B.sub.1 B.sub.2 . . . .
I- pictures are intra-picture encoded, that is to say the encoding is not based on any other reference pictures. An I- picture in a GOP is therefore passed from the frame reorderer 80 to the DCT transform unit 85, the quantizer 84 and the entropy encoder 85 to generate output compressed data representing that I- picture.
The compressed I-picture data is also passed from the quantizer 84 through a decompression chain formed by the inverse quantizer 86, and the inverse DCT transform unit 87. This reconstructs a version of the I- picture present in the decoder which is passed to the motion predictor 540.
The next picture of the GOP to be compressed, which will generally be a P-picture which depends on the I- picture as a reference, is passed from the frame reorderer 80 to the motion vector estimator 81 which generates motion vectors indicative of image motion between the I- and P- pictures. The motion compensator 89 then generates a predicted version of the P picture using the motion vectors and the decoded version of the I- picture. This predicted version of the P- picture is subtracted from the actual P- picture by the subtracter 82 and the difference between the two frames is passed to the DCT transform unit 85 and the quantizer 84 and the coder 85 for compression. As before, the encoded (compressed) difference data is output by the quantizer 85 and is then decoded by the decompression chain 86, 87 to regenerate a version of the difference data.
In the adder 88 the difference data is then added to the previously decompressed version of the I- picture to generate a decompressed version of the P-picture which is then stored in the motion predictor 89 for use in the compression of the next picture.
This process continues, so that each picture which uses other pictures as a reference is in fact compressed by encoding difference data between the input picture and a predicted version of the input picture formed by motion prediction from a previously compressed and then decompressed version of the reference picture. By using a predicted picture derived by decompressing and dequantizing, reconstruction errors are reduced in the finally displayed image. This is because the difference data is then the "error" between the input picture and the picture data which will be available at the decompressor to be added to the error to reconstruct the input picture.
Information identifying the type of picture I, B, P and information relating to quantization levels and motion vectors is conveyed as syntax data in headers associated with e.g. the macro blocks.
The corresponding decoder is shown in FIG. 10B from which it is apparent the predicted picture Sp is added to the decoded difference data .DELTA. in the time domain to produce the decoded picture Si.
If the same video signal is MPEG encoded, and decoded more than once, and if the data rate (quantization level) changes between generations errors in the reconstructed signal (i.e. the differences between the original video signal and the signal produced following one or more generations of encoding and decoding) increases with each generation.
Such encoding decoding and re-encoding and decoding over several generations may occur in for example editing systems using different encoded data rates at each generation. Such encoded signals are decoded to the time domain for frame accurate editing and then re-encoded. Such repeated, decoding and re-encoding may occur also in other circumstances.
British Patent Application 9621067.9 filed Oct. 9, 1996 (Attorney reference: I-96-1; P/749.GB; S96P5032GB00) proposes a method of processing digitally encoded signals comprising intra-encoded frames and inter-encoded frames, the inter-encoded frames having associated therewith respective quantization levels and respective motion vectors, the method comprising converting the inter-encoded frames to intra-encoded frames retaining unchanged the respective quantization levels. It has been found that, by retaining, unchanged, the respective quantization levels, the reconstruction error of intra-encoded frames is very small over many generations of decoding and re-encoding. This is shown in accompanying FIG. 8 where Yo and Co indicate the luminance and chrominance reconstruction errors for I-frames. Although there is some increase in error over many generations it is small. The figure is based on using codec `A` which encodes and decodes I-B 2-frame GOP followed by a codec `B` which encodes and decodes a single frame GOP (I-frame only). The results in FIG. 8 show the effects of cascading through a succession of A, B codecs thus: A, B, A, B, A etc. In FIG. 8, lines Y.sub.1 and C.sub.1 indicate error for B frames. As shown by Y.sub.1 and C.sub.1 the error increases using the B codec but then recovers to close to the first generation performance when followed by a third generation of codec `A`.
FIG. 8 indicates the reconstruction error as signal to noise ratio (dB), decreasing signal to noise ratio indicating increasing reconstruction error.
The present invention seeks to provide signal encoder said decoders which allow a reduction in reconstruction error when signals are repeatedly encoded and decoded.